<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('引流相关奖励明细列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 120px;">引流团队编号：</label>
                                <input type="text" name="teamYlId"/>
                            </li>
                            <li>
                                <label style="width: 120px;">引流团长编号：</label>
                                <input type="text" name="leaderId"/>
                            </li>
                            <li>
                                <label style="width: 120px;">引流团长代理编号：</label>
                                <input type="text" name="leaderAgentNum"/>
                            </li>
                            <li>
                                <label style="width: 120px;">奖励类型：</label>
                                <select name="profitType">
                                    <option value="">所有</option>
                                    <option value="14">引流奖励</option>
                                    <option value="15">引流人员入团补差</option>
                                    <option value="16">采购奖励</option>
                                    <option value="17">增量奖励</option>
                                    <option value="20">210激团奖（团长引流奖励 A）</option>
                                    <option value="21">传统引流奖励</option>
                                    <option value="22">分润税奖励</option>
                                    <option value="24">底薪计划</option>
                                </select>
                            </li>
                            <li>
                                <label style="width: 120px;">终端类型：</label>
                                <select name="posType">
                                    <option value="">所有</option>
                                    <option value="0">传统</option>
                                    <option value="4">电签</option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label style="width: 120px;">返现日期：</label>
                                <input type="text" readonly class="time-input" id="startTime" placeholder="开始时间" name="startDate"/>
                                <span>-</span>
                                <input type="text" readonly class="time-input" id="endTime" placeholder="结束时间" name="endDate"/>
                            </li>
                            <li>
                                <label style="width: 120px;">结算流水号：</label>
                                <input type="text" name="settleSerial"/>
                            </li>
                            <li>
                                <label style="width: 120px;">引流团员编号：</label>
                                <input type="text" name="teamYlTyId"/>
                            </li>
                            <li>
                                <label style="width: 120px;">引流团员代理编号：</label>
                                <input type="text" name="teamTyAgentNum"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
               <!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="detailed:detailed:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="detailed:detailed:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="detailed:detailed:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="detailed:detailed:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" class="table text-nowrap"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('detailed:detailed:edit')}]];
        var removeFlag = [[${@permission.hasPermi('detailed:detailed:remove')}]];
        var prefix = ctx + "detailed/detailed";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "引流相关奖励明细",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'teamYlId',
                    title: '引流团队编号'
                },
                {
                    field: 'leaderId',
                    title: '引流团长编号'
                },
                {
                    field: 'leaderAgentNum',
                    title: '引流团长代理编号'
                },
                {
                    field: 'createDate',
                    title: '创建日期'
                },
                {
                    field: 'leaderAgentName',
                    title: '引流团长代理名称'
                },
                {
                    field: 'posType',
                    title: '终端类型',
                    formatter(value,row,index){
                        if (value == '0'){
                            return "传统";
                        } else if (value == '4'){
                            return "电签";
                        } else {
                            return "未知";
                        }
                    }
                },
                {
                    field: 'profitType',
                    title: '奖励类型',
                    formatter(value,row,index){
                        if (value == '14'){
                            return "引流奖励";
                        } else if (value == '16'){
                            return "采购奖励";
                        } else if (value == '17'){
                            return "增量奖励";
                        }  else if (value == '20'){
                            return "210激团奖（团长引流奖励 A）";
                        }  else if (value == '21'){
                            return "传统引流奖励";
                        }   else if (value == '22'){
                            return "传统引流奖励";
                        }  else {
                            return "未知";
                        }

                    }

                },
                {
                    field: 'amount',
                    title: '本次奖励使用的总交易额'
                },
                {
                    field: 'policyRatio',
                    title: '本次奖励使用的比率'
                },
                {
                    field: 'policyId',
                    title: '本次奖励使用的政策编号'
                },
                {
                    field: 'returnMoney',
                    title: '奖励金额',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value);
                    }
                },
                {
                    field: 'taxPoint',
                    title: '税点'
                },
                {
                    field: 'returnTaxMoney',
                    title: '奖励金额(税后)',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value);
                    }
                },
                {
                    field: 'taxMoney',
                    title: '扣税金额',
                    formatter: function (value, row, index) {
                        return $.table.numberFormatter(value);
                    }
                },
                {
                    field: 'returnDate',
                    title: '返现日期'
                },
                {
                    field: 'settleSerial',
                    title: '结算流水号'
                },
                {
                    field: 'teamYlTyId',
                    title: '引流团员编号'
                },
                {
                    field: 'teamYlTyName',
                    title: '引流团员名称'
                },
                {
                    field: 'leaderName',
                    title: '引流团长名称'
                },
                {
                    field: 'teamTyAgentNum',
                    title: '引流团员代理编号'
                },
                {
                    field: 'teamTyAgentName',
                    title: '引流团员代理名称'
                },
                    {
                        field: 'note',
                        title: '备注'
                    },
                /*{
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }*/]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>